import {fetch_get,fetch_post} from "./index";
import {baseUrl,apiComment,apiMessage, apiProject} from "../config"
export async function postComment(name, content,id,text,blogId, blogTitle){
    
    const result = await fetch_post(baseUrl+`${apiComment}/${blogId}`,{
        name,
        content,
        id,
        text,
        blogTitle
    })
    return result.data;

}

export async function getComment(limit = 10,skip = 1,blogId){

   const result = await fetch_get(baseUrl+`${apiComment}/${blogId}?limit=${limit}&skip=${skip}`);

   return result.data;
}
export async function postMessage(name, content, id, text,blogTitle){
    
    const result = await fetch_post(baseUrl+`${apiMessage}`,{
        name,
        content,
        id,
        text
    })
    return result.data;

}
export async function getMessage(limit = 10,skip = 1){
    
    const result = await fetch_get(baseUrl+`${apiMessage}?limit=${limit}&skip=${skip}`);
    return result.data;

}

export async function getProject(limit = 10, skip = 1){

    const result = await fetch_get(baseUrl+`${apiProject}?limit=${limit}&skip=${skip}`);

    return result.data;

}
